#!/bin/bash

USERID=`id -u`
if [[ ! -e /tmp/emacs$USERID/server ]]
then
    emacs --daemon
    emacsclient -c "$@"
else
  emacsclient -c "$@"
fi
